{% extends '@WebsiteBundle/layout/baselayout.html.twig' %}
{% import "@WebsiteBundle/macros/pagination.html.twig" as macros %}
{% block seo_title %}
	{{ seoTitle }}
{% endblock %}
{% block seo_descr %}
	{{ seoDescr }}
{% endblock %}
{% block seo_kw %}
	{{ seoKw }}
{% endblock %}
{% block body_main %}
	{{ parent() }}
	<div class="page">
		{{ render(path('app_header', {"route":route, "sidebar":1} )) }}
		<div class="navbar-expand-md">
			<div class="navbar navbar-light">
				<div class="container-xl">
					<ul class="nav nav-pills">
						<li class="nav-item">
							<a class="nav-link {% if 0 == category %} active {% endif %}" aria-current="page" href="{{ path('app_news') }}">全部</a>
						</li>
						{% if tutorialCategory %}
							{% for item in tutorialCategory %}
								<li class="nav-item">
									<a class="nav-link {% if item['id'] == category %} active {% endif %}" href="{{ path('app_tutorial', {'category':item['id']}) }}">{{item['name']}}</a>
								</li>
							{% endfor %}
						{% endif %}
					</ul>

				</div>
			</div>
		</div>
		<div class="page-wrapper">
			<div class="page-body">
				<div class="container-xl">
					<div class="row row-cards mt-1">
						<div class="col-12 gy-0 vh-70">
							<div class="row row-deck">
								{% if list %}
									{% for item in list %}
										<div class="col-sm-12 col-lg-4">
											<div class="card">
												<div class="card-body">
													<div class="row align-items-center">
														<div class="col-3">
															<img src="{{ json_get(item['bigImg']) }}" alt="{{ item['name'] }}" class="rounded">
														</div>
														<div class="col">
															<h3 class="card-title mb-1">
																<a href="{{ path('app_tutorial_detail', {id:item['id']}) }}" class="text-reset">{{ item['name'] }}</a>
															</h3>
															<div class="text-muted">
																{{ item['updatedAtTime']|qtime}}更新
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
									{% endfor %}
									<div class="col-sm-12 col-lg-12 pagination ">
										{{ macros.pagination(pagination) }}
									</div>
								{% else %}
									{% include '@WebsiteBundle/empty.html.twig' %}
								{% endif %}
							</div>
						</div>
					</div>

				</div>
			</div>
		</div>
		{{ render(path('app_footer')) }}
	</div>
{% endblock %}
